package com.rul.mars.common.exception;

import com.rul.mars.common.api.CommonResultCode;

/**
 * 自定义API异常
 *
 * @author RuL
 */
public class ApiException extends RuntimeException {
    private CommonResultCode resultCode;

    public ApiException(CommonResultCode resultCode) {
        super(resultCode.getMessage());
        this.resultCode = resultCode;
    }

    public ApiException(String message){
        super(message);
    }

    public ApiException(Throwable cause){
        super(cause);
    }

    public ApiException(String message,Throwable cause){
        super(message, cause);
    }

    public CommonResultCode getResultCode(){
        return resultCode;
    }

}
